tests: Use GdkPixbuf for taking a screenshot, not GdkImage
authorBenjamin Otte <otte@redhat.com>
Tue, 13 Jul 2010 00:17:48 +0000 (02:17 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 26 Jul 2010 14:42:48 +0000 (16:42 +0200)
tests/testgtk.c

index 47da56870163008ee67242ed9836ba5ed733b8d9..e2d5d36f91669421619750c738147b2eff9b115a 100644 (file)
@@ -2070,7 +2070,7 @@ take_snapshot (GtkWidget *button,
   GdkGC *black_gc;
   GdkColor color = { 0, 30000, 0, 0 };
   GdkRectangle target;
-  GdkImage *shot;
+  GdkPixbuf *shot;
   
   /* Do some begin_paint_rect on some random rects, draw some
    * distinctive stuff into those rects, then take the snapshot.
@@ -2197,12 +2197,13 @@ take_snapshot (GtkWidget *button,
   target.width = width_fraction * 2;
   target.height = height_fraction * 2;  
 
-  shot = gdk_drawable_get_image (gid->src->window,
-                                 target.x, target.y,
-                                 target.width, target.height);
-
-  gtk_image_set_from_image (GTK_IMAGE (gid->snap),
-                            shot, NULL);
+  shot = gdk_pixbuf_get_from_drawable (NULL,
+                                       gid->src->window,
+                                       NULL,
+                                       target.x, target.y,
+                                       0, 0,
+                                       target.width, target.height);
+  gtk_image_set_from_pixbuf (GTK_IMAGE (gid->snap), shot);
 
   g_object_unref (shot);